project(vspUserInterface)

include(${qtExtensions_USE_FILE})

# Use the include path and library for Qt that is used by VTK
include_directories(SYSTEM
  ${VTK_INCLUDE_DIRS}
)

include_directories(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
)

if(QtTesting_FOUND AND BUILD_TESTING)
  add_definitions(-DENABLE_QTTESTING)
  include_directories(SYSTEM ${QtTesting_INCLUDE_DIRS})
  set(TESTING_INTERFACES qtTestingSupport)
endif()

###############################################################################

# BEGIN source file lists

set(vspUserInterface_Sources
    # Core code
    vsApplication.cxx
    vsCore.cxx
    vsCorePrivate.cxx
    vsMainWindow.cxx
    vsMainWindowPrivate.cxx
    vsScene.cxx
    vsScenePrivate.cxx
    # Supporting code
    vsAlertEditor.cxx
    vsAlertList.cxx
    vsContourWidget.cxx
    vsDebug.cxx
    vsEventDataModel.cxx
    vsEventInfoWidget.cxx
    vsEventRatingMenu.cxx
    vsEventTreeModel.cxx
    vsEventTreeSelectionModel.cxx
    vsEventTreeView.cxx
    vsEventTreeWidget.cxx
    vsNoteTreeWidget.cxx
    vsRegionList.cxx
    vsRegionTypeDelegate.cxx
    vsSettings.cxx
    vsTrackColorDialog.cxx
    vsTrackTreeModel.cxx
    vsTrackTreeSelectionModel.cxx
    vsTrackTreeView.cxx
    vsTrackTreeWidget.cxx
    vsUiExtensionInterface.cxx
# TODO: Everything below should be moved to either plugins or the application
    # Query formulation (viqui integration)
    vsQfDialog.cxx
    vsQfVideoPlayer.cxx
    vsQfVideoSource.cxx
    vsVideoPlayerModel.cxx
    # Built-in live descriptors - TODO: move to application?
    vsTripwireDescriptor.cxx
)

set(vspUserInterface_AMUI
    eventTree.ui
    noteTree.ui
    trackTree.ui
    vsp.ui
)

set(vspUserInterface_SdkHeaders
    # Core code
    vsApplication.h
    vsCore.h
    vsMainWindow.h
    vsScene.h
    # Supporting code
    vsEventUserInfo.h
    vsUiExtensionInterface.h
)

# END source file lists

###############################################################################

# BEGIN build rules

qte_amc_wrap_ui(vspUserInterface_AmSources ActionManagerDialog
  ${vspUserInterface_AMUI}
)

add_library(${PROJECT_NAME}
  ${vspUserInterface_Sources}
  ${vspUserInterface_AmSources}
)

target_link_libraries(${PROJECT_NAME}
  PUBLIC
  qtExtensions
  vtkVgCore
  vtkVgModelView
  vgVtkVideo
  vgGuiFramework
  vspData
  PRIVATE
  vgCommon
  qtVgCommon
  qtVgWidgets
  vvIO
  vvWidgets
  vtkVgQtUtil
  ${VTK_OPENGL_RENDERING_COMPONENTS}
  vtkCommonSystem
  vtkImagingStencil
  vtkGUISupportQt
  ${TESTING_INTERFACES}
# TODO: Only needed for code that should be moved out
  vtkVgSceneGraph
)

install_library_targets(${PROJECT_NAME})
install_headers(${vspUserInterface_SdkHeaders} TARGET ${PROJECT_NAME}
                DESTINATION include/VspUserInterface)

# END build rules
